<?php
	if(isset($_SESSION['GV']))
	{
		$MaGiaoVien = $_SESSION['GV']['MaGiaoVien'];
		include_once '../classes/giaovien_bs.php';
		$GiaoVien = new giaovien_bs();
		$GiaoVien->SetMaGiaoVien($MaGiaoVien);
		$DGiaoVien = $GiaoVien->LayDanhSach();
		
		$HoTen = $DGiaoVien[0]['HoTen'];
		$Email = $DGiaoVien[0]['Email'];
		$DienThoai = $DGiaoVien[0]['DienThoai'];
	
?>
<div id="DDThongTin">
	<div class="d1">
		<table class="tb1">
			<tr>
				<th colspan="2">THÔNG TIN NGƯỜI DÙNG</th>
			</tr>
			<tr>
				<td>Họ tên</td>
				<td><?php echo $HoTen; ?></td>
			</tr>
			<tr>
				<td>Mã GV</td>
				<td><?php echo $MaGiaoVien; ?></td>
			</tr>
			<tr>
				<td>Email</td>
				<td><?php echo $Email; ?></td>
			</tr>
			<tr>
				<td>Điện thoại</td>
				<td><?php echo $DienThoai; ?></td>
			</tr>
		</table>
		<table class="tb2">
			<tr>
				<td class="c"><a style="font-size:11px; width:100%" href="index.php?act=giaovien_capnhat">CẬP NHẬT THÔNG TIN</a></td>
				<td class="b"></td>
				<td class="c"><a style="font-size:11px; width:100%" href="index.php?act=doimatkhau">ĐỔI MẬT KHẨU</a></td>
				<td class="b"></td>
				<td class="c"><a style="font-size:11px; width:100%" href="index.php?act=logout">ĐĂNG XUẤT</a></td>
			</tr>
		</table>
	</div>
	<div class="d2">
		<table class="tb1">
			<tr>
				<th colspan="2">LỚP HỌC</th>
			</tr>
			<?php
				include_once '../classes/hopdong_bs.php';
				$HopDong = new hopdong_bs();
				$HopDong->SetMaGiaoVien($MaGiaoVien);
				$DHopDong = $HopDong->LayDanhSach();
				if($DHopDong != null)
				{
					include_once '../classes/lophoc_bs.php';
					$i = 0;
					while($i < 4)
					{
						if(isset($DHopDong[$i]))
						{
							$LopHoc = new lophoc_bs();
							$LopHoc->SetMaLopHoc($DHopDong[$i]['MaLopHoc']);
							$DLopHoc = $LopHoc->LayDanhSach();
							echo '<tr>';
								echo '<td>' . ($i + 1) .'</td>';
								echo '<td><a href="index.php?act=diemdanh&mlh=' . $DLopHoc[0]['MaLopHoc'] . '&pin=' . $DLopHoc[0]['PIN'] . '">' . $DLopHoc[0]['MaLopHoc'] . '</a></td>';
							echo '</tr>';
						}
						else
						{
							echo "<tr><td>" . ($i + 1) . "</td><td></td></tr>";
						}
						$i++;
					}
				}
			?>
			
		</table>
		<table class="tb2">
			<tr>
				<td class="c" style="width=100%; text-align:center; border:1px solid #1b7cb5">
					<a style="font-size:11px; width:100%" href="index.php?act=lophoc_danhsach">
					XEM TẤT CẢ
					</a>
				</td>
			</tr>
		</table>
	</div>
</div>
<?php
	}
	else
	{
		
	}
?>